import {Modal} from "antd";
import UploadListItem from "@/components/upload/upload-list-item";
import {Upload} from "@/components/upload";

export interface ImportProps {
  title: string;
  show: boolean;
}

export default function ExcelImport({title = '导入', show = false}: ImportProps) {
  return (
    <Modal
      title={title}
      open={show}
    >
      <Upload maxCount={1} accept='.xls,.xlsx' action='/api/management/t-user/balance/import' headers={{'X-Requested-With':'Hiwie-Fetch'}}/>
      {/*{parsedData.length > 0 && (*/}
      {/*  <div style={{ marginTop: 24 }}>*/}
      {/*    <h3>解析结果（示例前5条）:</h3>*/}
      {/*    <pre>{JSON.stringify(parsedData.slice(0, 5), null, 2)}</pre>*/}
      {/*  </div>*/}
      {/*)}*/}
    </Modal>
  )
}
